var policy;
<%- GET_TRUSTED_TYPES_POLICY  %> = <%- basicFunction("") %> {
    // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet.
    if (policy === undefined) {
        policy = {
            <% if (_create_script) { %>
            createScript: <%- returningFunction("script", "script") %>,
            <% } %>
            <% if (_create_script_url) { %>
            createScriptURL: <%- returningFunction("url", "url") %>,
            <% } %>
        };
        if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) {
            <% if (_wrap_try_catch) { %>
            try {
            <% } %>
            policy = trustedTypes.createPolicy("<%- _policy_name %>", policy);
            <% if (_wrap_try_catch) { %>
            } catch (e) {
                console.warn('Could not create trusted-types policy "<%- _policy_name %>"');
            }
            <% } %>

        }
    }
    return policy;
}